<template>
  <div class="app-container">
    <!-- banner列表 -->
    <el-table :data="list" stripe style="width: 100%">
      <el-table-column type="index" width="50"/>
      <el-table-column prop="saleplanname" label="营销活动名称"/>
      <el-table-column prop="areaid" label="地区编码"/>
      <el-table-column prop="svcid" label="业务类型"/>
      <el-table-column prop="joinmode" label="参与方式"/>
      <el-table-column prop="joinnum" label="参数次数"/>
      <el-table-column prop="joinpara1" label="参与条件1"/>
      <el-table-column prop="joinpara2" label="参与条件2"/>
      <el-table-column prop="joinpara3" label="参与条件3"/>
      <el-table-column prop="effdate" label="活动生效日期"/>
      <el-table-column prop="expdate" label="活动截止日期"/>
      <el-table-column prop="remarks" label="备注"/>
    </el-table>

    <!-- 分页 -->
    <el-pagination
        :current-page="current"
        :page-size="limit"
        :total="total"
        style="padding: 30px 0; text-align: center;"
        layout="total, prev, pager, next, jumper"
        @current-change="getList"
    />

  </div>
</template>
<script>
//引入api接口
import hospitalSetApi from "@/api/sale";

export default {
  // 定义数据模型
  data() {
    return {
      current: 1,
      limit: 3,
      searchObj: {},
      list: [], // 列表
      total: 0,
      b:true
    }
  },
  // 页面渲染成功后获取数据
  created() {
    this.getList();
  },

  methods: {//定义方法对api接口的方法调用
    //医院设置列表
    getList(page = 1) {
      this.current = page
      hospitalSetApi.getggkList(this.current, this.limit, this.b)
          .then(res => {
            this.current=this.page.current
            this.list = res.data.records
            this.total = res.data.total
            console.log(res)
          })//请求成功
          .catch(error => {
            console.log(error)
          })//请求失败
    }
  }
};
</script>

